#include <iostream>
#include <string>

using namespace std;
void fun_swap(int &val_1, int &val_2)
{
	cout << "我是整形交换函数" << endl;
	int temp = val_1;
	val_1 = val_2;
	val_2 = temp;
}
void fun_swap(double &val_3, double &val_4)
{
	cout << "我是浮点型交换函数" << endl;
	double temp = val_3;
	val_3 = val_4;
	val_4 = temp;
}

int main(int argc, char const *argv[])
{

	int val_1 = 415;
	int val_2 = 526;
	// 原始值
	printf("原始值为:val_1=%d,val_2=%d\n", val_1, val_2);
	fun_swap(val_1, val_2);
	printf(" val_1=%d,val_2=%d\n", val_1, val_2);

	double val_3 = 3.14;
	double val_4 = 4.13;
	printf("原始值为:val_3=%.2lf,val_4=%.2lf\n", val_3, val_4);
	fun_swap(val_3, val_4);
	printf(" val_3=%.2lf,val_4=%.2lf\n", val_3, val_4);

	return 0;
}
